Does anyone know how to make it so you can just press a key without havint to press Enter/Return in a windows console app?
Does anyone know how to make it so you can just press a key without havint to press Enter/Return in a windows console app?
its nonstandard but most compilers offer a getch(),getche(),_getch(),or _getche() functions. All of these will do the job of getting a single char from keyboard but only the onesending in 'e' echo that char to the screen.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
im pretty sure that what you want is in the awesome FAQ of this site
Paro
i tryed looking on the FAQ and they sed getch() but that doesnt work on MSVC++ =[
Yes it does, include conio.h.
no i tried it too on friday with MSVC++ and with <conio.h> it still gave me an error, is there any other way?
try sticking getch into your help files search. What comes up....
oh surprise..... _getch()
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
so its _getch()???? or just getch()
>no i tried it too on friday with MSVC++ and with <conio.h> it still gave me an error, is there any other way?
You must be doing something different to me then, as getch() definitely works, what error message do you get?
I concur, either getch() or _getch() works for me on msvcYou must be doing something different to me then, as getch() definitely works, what error message do you get?
Last edited by C_Coder; 02-17-2002 at 02:15 PM.
All spelling mistakes, syntatical errors and stupid comments are intentional.
this sucks, i cant program til i get back to school next week :'(
so i cant answer your question to what error, but i think it said "undeclared identifier"
The undeclared identifier message means you haven't included the correct header file.
Unless you commented it out or spelt it wrong.
All spelling mistakes, syntatical errors and stupid comments are intentional.